Skip to content

feat: switch VirtualTable producer to use expressions field instead of deprecated values#23672

Open
eliot1480 wants to merge 2 commits into
apache:mainfrom
eliot1480:remove-usages-of-deprecated-virtualtable-values-field
Open

feat: switch VirtualTable producer to use expressions field instead of deprecated values#23672
eliot1480 wants to merge 2 commits into
apache:mainfrom
eliot1480:remove-usages-of-deprecated-virtualtable-values-field

Conversation

@eliot1480

@eliot1480 eliot1480 commented Jul 17, 2026

Copy link
Copy Markdown

Which issue does this PR close?

Rationale for this change

Since the VirtualTables.values field has been deprecated and is soon to be removed in the next substrait update, we should make sure to delete all instances of it to prevent the presence of dead code.

This PR switches the producer to generate VirtualTables using only the expressions field. A later PR will be released to fully remove all instances of the values field. The reason removal will be separate is because we want to give users a chance to update any stored plans, and then remove values.

The consumer also needed an update, because since the producer only emits expressions, a new gap was introduced where expressions never uses named_struct.names to rename nested fields (structs/lists) the way the values/literal path does. So for flat/scalar columns, expressions would work fine, but for struct/list-typed columns, the consumer would silently drop original nested field names and fall back to positional defaults.

What changes are included in this PR?

Producer now emits VirtualTable.expressions for Values and EmptyRelation. Converted 17 direct virtualTable.values entries across 10 JSON test plans to virtualTable.expressions. Consumer now adds support for struct field-name preservation when reading from only expressions.

Are these changes tested?

Yes they are. Tests ran:

cargo check -p datafusion-substrait
cargo test -p datafusion-substrait -- test substrait_integration roundtrip_values
cargo test -p datafusion-substrait -- test substrait_integration consumer_integration
cargo test -p datafusion-substrait -- test substrait_integration builtin_expr_semantics_tests
cargo test -p datafusion-substrait -- test substrait_integration non_nullable_lists

jq validation for JSON fixtures

Are there any user-facing changes?

No.

@github-actions github-actions Bot added the substrait Changes to the substrait crate label Jul 17, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.84615% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.67%. Comparing base (f151c10) to head (b2e4cb5).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
...ubstrait/src/logical_plan/consumer/rel/read_rel.rs 79.54% 7 Missing and 2 partials ⚠️
...ubstrait/src/logical_plan/producer/rel/read_rel.rs 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #23672   +/-   ##
=======================================
  Coverage   80.66%   80.67%           
=======================================
  Files        1086     1086           
  Lines      366673   366740   +67     
  Branches   366673   366740   +67     
=======================================
+ Hits       295786   295853   +67     
+ Misses      53263    53261    -2     
- Partials    17624    17626    +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread datafusion/substrait/src/logical_plan/consumer/rel/read_rel.rs
Comment thread datafusion/substrait/src/logical_plan/consumer/rel/read_rel.rs Outdated

@vbarua vbarua left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about this from a migration perspective, I think we need to do ship this as 2 changes:

  1. Release a change that switches the producer to generate VirtualTables using only the expressions field.
  2. After that is live, release the change that fully removes the old values field.

Because the producer currently emits plans using the deprecated field, we need to give users a chance to update any stored plans, and then remove support for values.

Comment thread datafusion/substrait/src/logical_plan/producer/rel/read_rel.rs
@eliot1480
eliot1480 requested a review from vbarua July 21, 2026 20:17
@eliot1480 eliot1480 changed the title feat: removed all instances of deprecated virtualtable values field feat: switch VirtualTable producer to use expressions field instead of deprecated values Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

substrait Changes to the substrait crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove usages of deprecated VirtualTable.values field

3 participants